package com.example.mybatis1.mapper;

import com.example.mybatis1.model.ArticleInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * ClassName: ArticleInfoMapper
 * Package: IntelliJ IDEA
 * Description:
 *
 * @Author 谷京京
 * @Create 2023/11/16 15:30
 * @Version 1.0
 */
@Mapper
public interface ArticleInfoMapper {
    @Select("select * from articleinfo where id = #{articleId}")
    ArticleInfo selectById(Integer articleId);

    @Select("select ta.*, tb.username, tb.age from articleinfo ta left join userinfo tb on ta.uid = tb.id where ta.id = #{articleId}")
    ArticleInfo select(Integer articleId);
}
